package cn.netjava.personblogaction;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.netjava.actioninterface.Action;
import cn.netjava.dao.PhotoAlbumDao;
import cn.netjava.pojo.PhotoAlbum;
/**
 * this action is use for dealing with my person photo home page data
 * @author Administrator
 *
 */
public class PersonPhotoHomePageAction implements Action{

	public String excute(HttpServletRequest request,
			HttpServletResponse response) {
		int uid =Integer.parseInt(request.getParameter("uid"));
		
		/*get the user's photos' list the put it to the session object*/
		PhotoAlbumDao padao =PhotoAlbumDao.getPhotoAlbumDao();
		List<PhotoAlbum> photoAlbumList = padao.getUserPhotoAlbumFromUserID(uid);
		request.setAttribute("userPhotoAlbums", photoAlbumList);
		
		return "JSP/personblogjsp/personphotohome.jsp";
	}

}
